$def with (work, prefix="")

$ i18n_strings = {
    $ "empty_label": _("Please provide a label."),
    $ "empty_url": _("Please provide a URL."),
    $ "invalid_url": _("Please enter a valid URL.")
    $ }

<div id="link-errors" class="note hidden" data-i18n="$json_encode(i18n_strings)">
</div>

<fieldset class="major" id="links" data-prefix="$prefix">
    <div id="links-form" class="links-form">
        <div class="formElement">
            $:_('Please connect Open Library records to <u>good</u><span class="orange">*</span> online resources.')
        </div>

        <div class="formElement links-form__inputs">
            <div class="formElement links-form__label">
                <div class="label">
                    <label for="link-label">$_("Give your link a label")</label><br/>
                </div>
                <div class="input">
                    <input type="text" name="title" id="link-label" class="addweb" value=""/>
                    <span class="tip">$:_('For example: <em>New York Times review</em>')</span>
                </div>
            </div>
            <div class="formElement links-form__url">
                <div class="label">
                    <label for="link-url">$_("URL")</label>
                </div>
                <div class="input">
                    <input type="url" name="url" id="link-url" class="addweb" placeholder="https://..." />
                </div>
            </div>
        </div>
        <input type="button" id="repeat-add" class="repeat-add" value="$_('Add Link')"/>
    </div>

    <div class="formElement">
        <div class="label"></div>
        <div class="input">
            <ul class="booklinks" id="links-display">
                <li id="links-template" style="display: none;" class="repeat-item">
                    <div class="linkRemove"><a href="javascript:;" class="repeat-remove red plain" title="$_('Remove this link')">[x]</a></div>
                    <a href="{{url}}">{{title}}</a>
                    <span class="link wrap">{{url}}</span>
                    <input type="hidden" name="{{prefix}}links--{{index}}--title" value="{{title}}"/>
                    <input type="hidden" name="{{prefix}}links--{{index}}--url" value="{{url}}"/>
                </li>

                $for index, link in enumerate(work.links):
                    <li class="repeat-item">
                        <div class="linkRemove"><a href="javascript:;" class="repeat-remove red plain" title="$_('Remove this link')">[x]</a></div>
                        <a href="$link.url">$link.title</a><span class="link wrap">$link.url</span>
                        <input type="hidden" name="${prefix}links--${index}--title" value="$link.title"/>
                        <input type="hidden" name="${prefix}links--${index}--url" value="$link.url"/>
                    </li>
            </ul>
        </div>
    </div>

</fieldset>

<div class="formElement">
    <div class="tip footnote"><span class="orange">*</span> $_('"Good" means no spammy links, please. Keep them relevant to the book. Irrelevant sites may be removed. Blatant spam will be deleted without remorse.')</div>
</div>
